home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
comm
/
prtcs155.zip
/
QWK.WPL
< prev
next >
Wrap
Text File
|
1994-01-14
|
5KB
|
154 lines
/**/
v="$VER: QWK Wplrx Falcon-SMail QWK Mail Packer and Downloader Williamson 55.03"
auxdev ="CTDL-AUX:"
qwkcmd ="BBS:bin/smail >CTDL-AUX: <CTDL-AUX:"
qwkcfg ="BBS:smail/smail.cfg"
qwkdir ="ram:"
qwkfile="AMIGAECS.QWK"
options results
options failat 20
signal on syntax
signal on halt
signal on ioerr
signal on break_c
signal on break_d
baseport=GetClip('SHELTER')
logport=lower(baseport)||'wpl'
if ~show("L", "rexxsupport.library") then
if ~addlib("rexxsupport.library", 0, -30, 0) then exit 20
script="QWK"
sv=right(v,5)
log=show('P','ROOFLOG')
if ~showlist("H",auxdev) then do
options failat 99999
ADDRESS COMMAND 'MOUNT 'auxdev' FROM DEVS:MOUNTLIST.AUX'
options failat 20
end
rpath=addslash(dequote(GetClip('REXXDIR')))
quote='"'
cr='\r\n'
parse arg baud port username
call send(cr||' QWK Server v'sv' on $(host.sitename)'||cr)
call send(cr||' If you have a QWK packet to import, please exit and use the UL')
call send(cr||' to upload it. Do you wish to exit and upload a packet? (Y/n)')
resp=upper(getstring(60))
if resp="Y" then exit
call send(cr||' 'username' ,please enter your $(host.sitename) User Number: ')
unumber=getstring(60)
if fname="" | datatype(unumber) ~= 'NUM' | unumber=1 then do
call send(cr||'Sorry, your user number is required for QWK access')
call send(cr||'If you do not know it, you must enter the BBS and ask the sysop'||cr)
call cleanup()
exit 0
end
Call PutLog('Launching QWK Server @ 'baud' bps',10,10)
call send(cr||' Please note that if you pack any mail, it will be sent')
call send(cr||' to you automatically via Zmodem AutoDownLoad')
'Set DOOR TRUE'
process=word(qwkcmd,1)
address AREXX rpath'Carrier 'baseport||port process
call delay(50)
cmd=qwkcmd unumber qwkcfg
address COMMAND cmd
'Set DOOR FALSE'
if exists(qwkdir||qwkfile) then do
call send(cr||' Ready, be sure Zmodem is your default protocol and AutoDownLoad is ON')
call send(cr||' By the way, you can upload your QWK reply packet right after your')
call send(cr||' download is completed.'||cr)
call delay(50)
call fxfer()
end
call send(cr||'QWK Server exiting'||cr)
exit 0
fxfer:
'Set inbound' qwkdir
'Set protocol Zmodem'
'XprSetup xprzedzap.library "TN,ON,B16,F0,E30,AN,DN,KN,SY,RN,M1024"'
'SetUpDate "CON:0/$($(line).w_offset)/640/130/QWK Server/AUTO/SCREEN$(pscreen)"'
'XprSetFile' qwkdir||qwkfile qwkfile 'K'
'XprSend 'qwkdir||qwkfile
call send(cr||cr||'$(filestatus): $(cps) CPS ($(cpsp)%) of $(baud) Bps')
call send(cr||'If you wish to upload a QWk packet, start your transfer now'||cr)
'XprReceive ""'
'RexxMsg NY LOGPROC "PutLog $<time> QWK $(protocol) Recv:$(RC)"'
'XprClose'
'SetUpDate NULL'
return
send:
'Print' quote||arg(1)||quote
'Send' quote||arg(1)||quote
return
getstring:
'GetInbound E0 'arg(1)
'String $(event)'
if upper(RESULT) = 'CARRIER' then do
address LOGPROC 'PutLog' logport "$<time> $(line) GRAB 'fname' dropped Carrier"'
call PutLog('User 'fname' dropped carrier',10,10)
call cleanup
exit
end;else if upper(RESULT) = 'LOGIN' then do
'String $(namebuf)'
x= upper(RESULT)
end;else x=""
return x
PutLog: procedure expose log script logport port
if arg(3) < GetClip('STATUSLEVEL') then say arg(1)
if arg(2) > GetClip('LOGLEVEL') then return 0
if log then address 'ROOFLOG' 'logline' left(time(),5) script': 'arg(1)
else address LOGPROC 'PutLog' logport '"'time() port 'GRAB' arg(1)'"'
return 0
addslash:
curr = arg(1)
select
when right(curr, 1) = ":" then nop
when right(curr, 1) = "/" then nop
otherwise curr = curr"/"
end
return curr
/* a useful procedure by Walt Sullivan */
dequote:
parse arg thing
parse var thing '"' unq_thing '"'
if unq_thing ~= "" then return unq_thing
return thing
lower:
return(bitor(arg(1),'20'x))
cleanup:
return
/* Error handling */
break_c:
break_d:
PutLog('User abort',10,10)
call cleanup
exit 10
/* Miscellaneous utility functions */
/* handle references to uninitialized variables by saying which line */
/* and typing the offending line. */
template_oops:
parse arg what badline code
if code ~= "" then call PutLog("ERR: Line "badline what errortext(code),10,10)
else call PutLog("ERR: Line" badline what,10,10)
exit(40)
/**/